<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head>
	<th:block th:include="include :: header('运行中的流程')" />
</head>
<body class="gray-bg">

	<div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="config-form">
					<div class="select-list">
						<ul>
						    <li>
								流程实例ID：<input type="text" name="processId"/>
							</li>
						    <li>
								流程定义Key：<input type="text" name="procDefKey"/>
							</li>
							<li>
								<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-success btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table"></table>
			</div>
		</div>
	</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var removeFlag = [[${@permission.hasPermi('activiti:process:remove')}]];
    var prefix = ctx + "/activiti/process";

    $(function () {
        var options = {
        	uniqueId: "processInstanceId",
            url: prefix + "/runningList",
            removeUrl: prefix + "/deleteProcIns",
            modalName: "运行中的流程",
            search: false,
            showExport: false,
            columns: [{
                checkbox: true
            },
            {
                field: 'businessKey',
                align: 'center',
                title: '业务key'
            },
            {
                field: 'processInstanceId',
                align: 'center',
                title: '流程实例ID'
            },
            {
                field: 'processDefinitionKey',
                align: 'center',
                title: '流程定义KEY'
            },
            {
                field: 'activityId',
                align: 'center',
                title: '当前环节'
            },
            {
                field: 'suspended',
                align: 'center',
                title: '是否挂起',
                formatter: function (value, row, index) {
                    return row.suspended?'是':'否';
                }
            },
            {
                field: 'processDefinitionVersion',
                title: '版本'
            },
            {
                title: '操作',
                align: 'center',
                formatter: function (value, row, index) {
                    var actions = [];
                    actions.push('<a class="btn btn-danger btn-xs" href="#" onclick="$.operate.remove(\'' + row.processInstanceId + '\')"><i class="fa fa-remove"></i>删除</a>');
                    return actions.join('');
                }
            }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>